package com.ny.zmb.openapi.controller;


import com.ny.zmb.openapi.controller.entity.Result;
import com.ny.zmb.openapi.service.PmOrderRefundLogService;
import com.ny.zmb.openapi.ysutil.from.BizReqJsonCollege.BizReqJson;
import com.ny.zmb.openapi.ysutil.from.BizReqJsonCollege.BizReqJsonRefund;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * Ys退款
 * 20241121 czz
 */


@RestController
@CrossOrigin
@RequestMapping("ys/refund")
public class YsRefundController {


    @Resource
    private PmOrderRefundLogService pmOrderRefundLogService;

    /**
     * 退款
     *
     * @param srcMerchantNo 商户号
     * @param obj           请求体
     * @return Result
     */
    @PostMapping("refund")
    public Result refund(@RequestBody BizReqJsonRefund obj, @RequestParam(required = false) String srcMerchantNo) {
        return pmOrderRefundLogService.refund(srcMerchantNo, obj);
    }

    /**
     * 查询退款
     *
     * @param obj
     * @param srcMerchantNo
     * @return
     */
    @GetMapping("/queryTradeRefund")
    public Result refundPost(@RequestBody BizReqJsonRefund obj, @RequestParam(required = false) String srcMerchantNo) {
        return pmOrderRefundLogService.queryTradeRefund(srcMerchantNo, obj);
    }

}
